// 定义baseUrl
const baseUrl = "http://111.67.198.176:8112";
export const request = params =>{
  // let header =params.header;

  wx.showLoading({
    title: '正在加载中',
  });
  return new Promise((resolve,reject)=>{
    wx.request({
      ...params,
      header:{
        Authorization:wx.getStorageSync('token')
      },
      url:baseUrl + params.url,
      success:result=>{
        resolve(result)
      },
      fail:err=>{
        reject(err)
      },
      complete:()=>{
        // 关闭动画
        wx.hideLoading();
      }
    })
  })
}